<?php
/* @var $this NdkHealthController */
/* @var $model NdkHealth */


$this->breadcrumbs=array(
	'Ndk Healths'=>array('index'),
	'Manage',
);

$this->menu=array(
	array('label'=>'List NdkHealth', 'url'=>array('index')),
	array('label'=>'Create NdkHealth', 'url'=>array('create')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$('#ndk-health-grid').yiiGridView('update', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<!--<h1>Manage Nota Debet/Kredit Medical</h1>-->
<h1>Nota Kredit Health</h1>


<a href="<?php echo Yii::app()->createUrl('NdkHealthKredit/create'); ?>" class="btn btn-sm btn-primary">Tambah</a><br /><br />

<?php //echo CHtml::link('Search','#',array('class'=>'search-button btn')); ?>
<!--<div class="search-form">
<?php /*$this->renderPartial('_search',array(
	'model'=>$model,

)); 
*/?>
</div>-->

<?php $this->widget('bootstrap.widgets.TbGridView',array(
	'id'=>'ndk-health-grid',
	'dataProvider'=>$model->search(),
	//'filter'=>$model,
	'columns'=>array(
		array(
			'header'=>'Nota Debet No',
			'value'=>'$data->posting==\'1\' ? \'\' : $data->nota_debet_no',
			),
		array(
			'header'=>'No Polis',
			'value'=>'RegHealthPolicy::model()->findByPk($data->reg_health_policy_id)->policy_no',
			),
		array(
			'header'=>'Periode Polis',
			'value'=>'date("d-m-Y",strtotime(RegHealthPolicy::model()->findByPk($data->reg_health_policy_id)->start_periode)) ." s/d ". date("d-m-Y",strtotime(RegHealthPolicy::model()->findByPk($data->reg_health_policy_id)->end_periode))',
			),
		array(
			'header'=>'Premi',
			'value'=>'number_format($data->premium,0,\',\',\'.\')',
			),
		array(
                'class'=>'bootstrap.widgets.TBButtonColumn',
               'template' => '{lihat}{posting}{print}',
               'buttons' => array(
               				'lihat' => array(
                              'url' => 'Yii::app()->createUrl("NdkHealthKredit/view", array("id"=>$data->id))',
								'options'=>array(
								'class'=>'btn btn-small view'
								)
                            ),

               				'posting' => array(
               				  'visible'=>'$data->posting==1',	
                              'url' => 'Yii::app()->createUrl("NdkHealthKredit/posting", array("id"=>$data->id))',
								'options'=>array(
								'class'=>'btn btn-small view'
								)
                            ),
                            
               				/*
                            'ubah' => array(
                              'visible'=>'$data->posting==1',	
                              'url' => 'Yii::app()->createUrl("NdkHealthKredit/update", array("id"=>$data->id))',
								'options'=>array(
								'class'=>'btn btn-small view'
								)
                            ),
                            */
                            
							


                            'print' => array(
                              'url' => 'Yii::app()->createUrl("NdkHealthKredit/cetak", array("id"=>$data->id))',
                              'options'=>array(
                                   'class'=>'btn btn-small print'
                                   ),
                            ),

                            

                     /*         
                    'delete' => array(
                         'label'=> 'Delete',
                         'url'=>'Yii::app()->createUrl("ndkHealth/delete",array("id"=>$data->id))',
                         'options'=>array(
                              'class'=>'btn btn-small delete'
                         )
                    )
                    */
               ),
            'htmlOptions'=>array('style'=>'width: 250px'),
           )
	),
)); ?>